﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace MyPaint
{
    public partial class FrmHistory : Form
    {
        public FrmHistory()
        {
            InitializeComponent();

            this.MinimumSize = new Size(350, 450);

            int count = 10;
            while (count-- > 0)
            {
                Button btn = new Button();
                btn.Size = new Size(50, 50);
                btn.Dock = DockStyle.Top;
                historyPanel.Controls.Add(btn);
            }
        }

        public FrmHistory(List<Image> images) : this()
        {
            if (images == null || images.Count == 0) return;

            //将图片引用加到控件上
            foreach (Image image in images)
            {
                Button btn=new Button();
                btn.Click += Btn_Click;
                btn.Size = new Size(50, 50);
                btn.Dock = DockStyle.Top;
                historyPanel.Controls.Add(btn);
            }
        }

        private void Btn_Click(object sender, EventArgs e)
        {
            //回调函数 影响主界面 图形显示信息
            
        }
    }
}
